package cn.kxlove.zhbj.pager;

import android.app.Activity;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.ImageButton;
import android.widget.TextView;

import org.xutils.view.annotation.Event;
import org.xutils.view.annotation.ViewInject;
import org.xutils.x;

import cn.kxlove.zhbj.MainActivity;
import cn.kxlove.zhbj.R;

/**
 * @author kxlove 16/1/27 19:42
 */
public abstract class BasePager {

    public Activity mActivity;
    public View mRootView;

    @ViewInject(R.id.fl_content)
    public FrameLayout flContent;
    @ViewInject(R.id.tv_title)
    public TextView tvTitle;
    @ViewInject(R.id.btn_menu)
    public ImageButton btnMenu;

    public BasePager(Activity activity){
        mActivity = activity;
        mRootView = initView();
    }

    /**
     * 初始化布局
     */
    public View initView(){
        View view = View.inflate(mActivity, R.layout.base_pager,null);
        x.view().inject(this,view);
        return view;
    }

    public abstract void initData();

    @Event(R.id.btn_menu)
    private void btnMenuClick(View v){
        MainActivity mainUi = (MainActivity) mActivity;
        mainUi.getLeftMenuFragment().toggle();

    }
}
